﻿using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Text;

namespace Helpers.Extensions
{
    public class DiHelperExt
    {
        public enum HttpClientNameEnum { proxy, noproxy, smdo, simple }
        public static HttpClient GetHttpClient(IServiceProvider serviceProvider, HttpClientNameEnum httpClientName)
        {
            var clientFactory = serviceProvider.GetRequiredService<IHttpClientFactory>();
            return clientFactory.CreateClient(httpClientName.ToString());
        }
    }
}
